
angular.module('starter.controllers')
    .controller('PlaneCityCtrl',['$scope','$http',"$rootScope","$ionicHistory","$anchorScroll","$location","$cacheFactory",function($scope,$http,$rootScope,$ionicHistory,$anchorScroll,$location,$cacheFactory) {

      $scope.changeDiv=function(div){
        $location.hash(div);
      };
      $http.get("../../data/hotcity.xml",  {
          transformResponse: function (cnv) {
            var x2js = new X2JS();
            var aftCnv = x2js.xml_str2json(cnv);
            return aftCnv;
          }
        })

        .success(function (response) {
          console.log(response);
          $scope.Keys={};
          response.ArrayOfQueryResult.QueryResult.forEach(o=>{
            $scope.Keys[o.Key]=o;
          })
          console.log($scope.Keys);
        })



        $scope.cityValue=function ($event) {
        var a=$event.target.innerHTML;
        $rootScope.OrgCity=a;
        console.log(a);
        $ionicHistory.goBack();
        }



      $scope.International=function () {
        alert("正在开发中。。。。。")
      }



 }]);

